/**
 * @import libs
 */
import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useIndexStaticMessStore = defineStore('indexStaticMess', () => {
    
    /**
     * 推荐部分索引
     */
    const recommendPartIndex= ref(0)
    
    /**
     * 热门活动索引
     */
    const popularActivityIndex = ref(1)

    /**
     * 关注部分索引
     */
    const attentionPartIndex = ref(2)
    
    /**
     * 顶部导航栏内容列表
     * @type {Array<{id:number, name:string}>}
     */
    let navTopBarList = ref([
        {
            id: 0,
            name: '推荐'
        },
        {
            id: 1,
            name: '热门活动'
        },
        {
            id: 2,
            name: '关注'
        }
    ])

    /**
     * 推荐帖子列表
     * @type {Array<{id:number, nickName:string, avatar:string, time:string, content:string, imageUrl:string, likeCount:number, shareCount:number}>}
     */
    let recommendedPostList = ref([
        {
            id: 0,
            userId:1,
            nickName: '电小小',
            avatar: '/static/imgs/recommendedPostAvatar_1.png',
            time: '1天前',
            content: '好朋友当然要一起拍照啦！',
            imageUrl: '/static/imgs/recommendedPostImg_1.png',
            likeCount: 1520,
            shareCount: 123
        }, {
            id: 1,
            userId:0,
            nickName: '科小宠',
            avatar: '/static/imgs/recommendedPostAvatar_2.png',
            time: '2天前',
            content: '可爱狗狗在线购物，快来围观！',
            imageUrl: '/static/imgs/recommendedPostImg_2.png',
            likeCount: 1314,
            shareCount: 654
        }
    ])

    /**
     * 热门活动状态 (未开放)
     */
    const activityStateBeforeOpen = '未开放'

    /**
     * 热门活动状态 (进行中)
     */
    const activityStateOpen = '进行中'

    /**
     * 热门活动状态 (已结束)
     */
    const activityStateClose = '已结束'

    /**
     * 热门活动列表
     * @type {Array<{id:number, title:string, time:string, state:string, imageUrl:string}>}
     */
    let activityMessList = ref([
        {
            id: 0,
            title: '人宠天仙配活动',
            time: '2023.6.12-2023.6.16',
            state: activityStateOpen,
            imageUrl: '/static/imgs/popularActivityImg_1.png'
        },
        {
            id: 1,
            title: '爱宠时尚秀活动',
            time: '2023.7.01-2023.7.08',
            state: activityStateClose,
            imageUrl: '/static/imgs/popularActivityImg_2.png'
        },
        {
            id: 2,
            title: '爱宠大赏活动',
            time: '2023.7.09-2023.7.16',
            state: activityStateClose,
            imageUrl: '/static/imgs/popularActivityImg_3.png'
        }
    ])


    return {
        navTopBarList,
        recommendedPostList,
        activityMessList,
        activityStateBeforeOpen,
        activityStateOpen,
        activityStateClose,
        recommendPartIndex,
        popularActivityIndex,
        attentionPartIndex
    }

})    